package com.hyt.it.ogt.kq.common.gov.enums.admission.variable;

import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;

import com.hyt.it.ogt.kq.common.gov.constant.admission.AdmissionTicketTemplateCode;

/**
 * 标准模板1配置 包含私有的和公有的
 *
 * @author zhoumiao
 * @since 2023/2/15 11:38
 **/
public interface Standard1TemplateConfigCode {
    String getCode();

    String getText();

    static List<Standard1TemplateConfigCode> privateConfigs() {
        return Arrays.stream(Standard1TemplateConfigCode.PrivateConfigCode.values()).collect(Collectors.toList());
    }

    static List<Standard1TemplateConfigCode> publicConfigs() {
        return Arrays.stream(Standard1TemplateConfigCode.PublicConfigCode.values()).collect(Collectors.toList());
    }

    // 私有的
    enum PrivateConfigCode implements Standard1TemplateConfigCode {
        // 私有信息
        NAME(AdmissionTicketTemplateCode.NAME, "姓名"),
        SEX(AdmissionTicketTemplateCode.SEX, "性别"),
        ID_CARD(AdmissionTicketTemplateCode.ID_CARD, "证件号码"),
        TIME_NAME(AdmissionTicketTemplateCode.TIME_NAME, "批次名称"),
        SUBJECT_NAME(AdmissionTicketTemplateCode.SUBJECT_NAME, "科目名称"),
        EXAM_ID(AdmissionTicketTemplateCode.EXAM_ID, "考试id"),
        EXAM_START(AdmissionTicketTemplateCode.EXAM_START, "考试开始时间"),
        EXAM_END(AdmissionTicketTemplateCode.EXAM_END, "考试结束时间"),
        EXAM_TIME(AdmissionTicketTemplateCode.EXAM_TIME, "考试时间"),
        CERTIFICATE_PHOTO(AdmissionTicketTemplateCode.CERTIFICATE_PHOTO, "证件照"),
        ;
        String code;
        String text;

        PrivateConfigCode(String code, String text) {
            this.code = code;
            this.text = text;
        }

        public String getCode() {
            return code;
        }

        public String getText() {
            return text;
        }
    }

    // 公共的 添加后需要在初始化时进行填充默认值 涉及方法 AdmissionTicketTemplateVariableServiceImpl.initStandardTemplateVariable
    enum PublicConfigCode implements Standard1TemplateConfigCode {
        // 公共信息
        EXAM_URL(AdmissionTicketTemplateCode.EXAM_URL, "考试链接"),
        EXAM_AGREEMENT(AdmissionTicketTemplateCode.EXAM_AGREEMENT, "考生须知"),
        EXAM_NAME(AdmissionTicketTemplateCode.EXAM_NAME, "考试名称"),
        CERTIFICATE_PHOTO(AdmissionTicketTemplateCode.CERTIFICATE_PHOTO, "证件照"),
        ;

        String code;
        String text;

        PublicConfigCode(String code, String text) {
            this.code = code;
            this.text = text;
        }

        public String getCode() {
            return code;
        }

        public String getText() {
            return text;
        }
    }
}
